<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>缺陷详情</title>
    <link href="../css/list-detial.css" type="text/css" rel="stylesheet"/>
</head>
<body>

<!--header-->
<header id="header" class="header">
    <div class="header-info left"><i></i><a href="pm-bug-list.html">缺陷列表</a>&nbsp;>&nbsp;缺陷详情</div>
    <div class="right-user right">
         <div class="clear t" >             <div id="headusername" class="role"></div>             <div class="icon"></div>         </div>
        <div class="head-down">
            <ul><li><a href="edit-pwd.html">修改密码</a></li><li><a onclick="loginOut()">退出系统</a></li></ul></div><div>
    </div>
    </div>
</header>
<!--menu-->
<aside id="aside" class="aside">
    <div class="logo">运营平台</div>
    <ul class="menu" id="asidemenu">
    </ul>
</aside>

<!--content-->
<div class="content">
    <div class="page-inner">
        <div class="page-content">
            <div class="table-head clear"><div class="left document-name"><i class="bug-i"></i></div><div class="right edit" id="goToEdit"><a onclick="edit()" class="sure">编辑</a></div></div>
            <!-- pm-bug-detail-edit.html -->
            <div class="table-cont">
                <table class="content-table">
                    <tr>
                        <td>缺陷主题：</td>
                        <td colspan="2" id="name"></td>
                    </tr>
                    <tr>
                        <td>来源：</td>
                        <td id="projectName"></td>
                        <td>紧急程度：</td>
                        <td id="level"></td>
                    </tr>
                    <tr>
                        <td>产品：</td>
                        <td id="product"></td>
                        <td>功能模块:</td>
                        <td id="feature"></td>
                    </tr>
                    <tr>
                        <td>使用平台：</td>
                        <td id="plat"></td>
                        <td>缺陷类型：</td>
                        <td id="issueType"></td>
                    </tr>
                    <tr>
                        <td>使用网络：</td>
                        <td id="networkType"></td>
                        <td>浏览器及其版本：</td>
                        <td id="browser"></td>
                    </tr>
                    
                    <tr>
                        <td>缺陷状态：</td>
                        <td id="status"></td>
                        <td>优先级：</td>
                        <td id="priority"></td>
                    </tr>

                    <tr>
                        <td>手机及型号：</td>
                        <td colspan="3" id="mobileType"></td>
                    </tr>
                    <tr class="area">
                        <td>缺陷描述：</td>
                        <td colspan="3" id="discribe">
                            
                        </td>
                    </tr>
                    <tr class="area">
                        <td>反馈信息：</td>
                        <td colspan="3" id="remark">
                            
                        </td>
                    </tr>
                    <tr class="area">
                        <td>附件：</td>
                        <td colspan="3">
                            <ul class="addAttachmentList" id="addAttachmentList">
                            </ul>
                        </td>
                    </tr>
                    
                </table>

                <!-- <table class="table-log">
                    <tr>
                        <td>
                            <span class="name">小丽</span><span class="time">&emsp;&emsp;2016.12.26  13：28&emsp;&emsp;</span><span class="opera">将状态由 <b>新建</b> 变更为 <b>开发中</b></span>
                            <p class="msg">收到并安排开发解决</p>
                        </td>
                    </tr>
                </table> -->
            </div>
        </div>
    </div>
</div>
<script src="../js/jquery.min.js"></script>
<script src="../js/jquery.cookie.js"></script>
<script src="../js/common.js"></script>
<script type="text/javascript">
    var _id = getUrlId();

    //编辑权限控制
    var roleid = $.cookie('userrole');
    if(roleid==1 || roleid==2 || roleid==3){
        $('#goToEdit').remove()
    }
    function edit(){
        location.href = 'pm-bug-detail-edit.html?id='+_id;
    }

    var attachment = new attachment();
    function updata(){
        var url  = _ip+'/issue/getIssueById?callback=update&id='+_id;
        $.ajax({
            url:url,
            type: 'GET',
            dataType: 'jsonp',
            contentType:'application/json',
            jsonpCallback: 'update',
            success:function(data){
                if(data.success){
                    var data = data.data;
                    $('.document-name').append('ID.'+data.id)
                    $('#name').html(data.name);
                    $('#projectName').html(data.projectName);
                    $('#level').html(data.level);
                    $('#product').html(data.product);
                    $('#feature').html(data.feature);
                    $('#plat').html(data.plat);
                    $('#issueType').html(data.type)
                    $('#networkType').html(data.networkType);
                    $('#browser').html(data.browser);
                    $('#mobileType').html(data.mobileType);
                    $('#discribe').html(data.discribe);
                    $('#remark').html(data.remark);
                    $('#priority').html(data.priority);
                    $('#status').html(data.status);
                    if(data.attachment){
                        attachment.init({
                            addAttachmentList:$('#addAttachmentList'),
                            isDetail:true
                        }).getAttachmentList(data.attachment.split(',')); 
                    }
                    

                }else{
                    alert(data.message);
                }
            }
        })
    }
    updata();

</script>
</body>
</html>